package com.ym.domain.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnType;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Table
@TableComment("一口价订单表")
public class OdBuyItNow {

    @TableId(type = IdType.ASSIGN_ID)
    @IsKey
    @Column
    @ColumnComment("主键ID")
    private Long id;

    @Column(length = 30)
    @ColumnComment("订单号")
    private String orderNo;

    @Column
    @ColumnComment("客户ID")
    private Integer customerId;

    @Column(length = 11)
    @ColumnComment("客户手机号")
    private String mobile;

    @Column
    @ColumnComment("订单时间")
    private LocalDateTime orderTime;

    @Column
    @ColumnComment("订单状态(0-支付中,1-支付成功,2-支付失败,3-抢购成功,4-抢购失败,5-抢购部分成功)")
    private Short orderStatus;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("订单总额")
    private BigDecimal orderAmount;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("实际支付总额。订单金额减去退款")
    private BigDecimal actualPayAmount;

    @Column
    @ColumnType(value = MySqlTypeConstant.DECIMAL, length = 18, decimalLength = 2)
    @ColumnComment("利润总额")
    private BigDecimal profit;

    @Column
    @ColumnComment("支付时间")
    private LocalDateTime payTime;

    @Column
    @ColumnComment("抢购时间。域名抢购成功时间")
    private LocalDateTime buyTime;

    @Column
    @ColumnType(value = MySqlTypeConstant.TEXT)
    @ColumnComment("备注。客户对订单的额外说明或要求")
    private String remark;

    @Column(length = 30)
    @ColumnComment("对应充值订单的订单号")
    private String rechargeOrderNo;

    @Column
    @ColumnComment("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

}
